<extend name="Public/base"/>

<block name="body">
	<div class="main-title cf">
		<h2><if condition="$_GET['_action'] eq 'add'">新增<else/>编辑</if>广告位</h2>
	</div>
    <div class="with-padding">
        <!-- 表单 -->
        <form id="form" action="{:addons_url('Advertising://Advertising/update')}" method="post" class="form-horizontal">
            <!-- 基础文档模型 -->
            <div id="tab1" class="tab-pane in tab1">
                <div class="form-item cf">
                    <label class="item-label">位置标识<span class="check-tips">（<span style="color: red">英文</span>，请输入广告显示的标识，调用的时候参数）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large form-control" name="pos" value="{$info.pos}" style="width: 400px;">
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">位置名称<span class="check-tips">（请输入广告显示的位置）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large form-control" name="title" value="{$info.title}" style="width: 400px;">
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">广告类型<span class="check-tips">（请选择广告类型，默认为单图）</span></label>
                    <div class="controls">
                        <label style="margin-right: 10px;"><input type="radio" value="1" <eq name="info['type']" value="1">checked</eq> <if condition="$_GET['_action'] eq 'add'">checked</if> name="type"> 单图</label>
                        <label style="margin-right: 10px;"><input type="radio" value="2" <eq name="info['type']" value="2">checked</eq> name="type"> 多图</label>
                        <label style="margin-right: 10px;"><input type="radio" value="3" <eq name="info['type']" value="3">checked</eq> name="type"> 文字</label>
                        <label style="margin-right: 10px;"><input type="radio" value="4" <eq name="info['type']" value="4">checked</eq> name="type"> 代码</label>
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">多图广告样式<span class="check-tips">（仅对多图类型有效）</span></label>
                    <div class="controls">
                        <label style="margin-right: 10px;"><input type="radio" value="1" <eq name="info['style']" value="1">checked</eq> <if condition="$_GET['_action'] eq 'add'">checked</if> name="style"> 样式1</label>
                        <label style="margin-right: 10px;"><input type="radio" value="2" <eq name="info['style']" value="2">checked</eq> name="style"> 样式2</label>
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">广告位宽度<span class="check-tips">（广告在前端展示的宽度）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large form-control" name="width" value="{$info.width}" style="width: 400px;">
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">广告位高度<span class="check-tips">（广告在前端展示的高度）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large form-control" name="height" value="{$info.height}" style="width: 400px;">
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">广告位边缘间隔<span class="check-tips">（上 右 下 左，如10px 5px 10px 5px）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large form-control" name="margin" value="{$info.margin}" style="width: 400px;">
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">广告位内部留白<span class="check-tips">（上 右 下 左，如10px 5px 10px 5px）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large form-control" name="padding" value="{$info.padding}" style="width: 400px;">
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">广告显示的主题<span class="check-tips">（在哪些主题下显示该广告位，填写‘all’为全部主题通用）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large form-control" name="theme" value="{$info.theme}" style="width: 400px;">
                    </div>
                </div>


            </div>
            <input type="hidden" name="id" value="{$info.id}"/>
            <br/>
            <div class="form-item cf">
                <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
                <input class="btn btn-return" type="reset" value="重置" />
            </div>
        </form>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function(){
            $('#submit').click(function(){
                $('#form').submit();
            });
        });
    </script>
</block>